package com.gwt.material.client.user.service;

import com.gwt.material.client.user.dto.WechatAuthDTO;
import com.gwt.material.client.user.dto.WechatUserDTO;
import com.gwt.material.client.user.po.WechatUser;
import com.mybatisflex.core.service.IService;

/**
 *  服务层。
 *
 * @author zbr
 * @since 2024-08-26
 */
public interface WechatUserService extends IService<WechatUser> {

    /**
     * 根据openID查询用户信息
     * @param openId openId
     * @return WechatUserDTO
     */
    WechatUserDTO getWechatUserByOpenId(String openId);

    /**
     * 创建微信用户
     * @param wechatAuthDTO
     * @return WechatUser
     */
    WechatUser createWechatUser(WechatAuthDTO wechatAuthDTO);

    /**
     * 获取微信二维码地址
     * @return
     */
    String wechatQrCode();

    /**
     * 调用微信接口，获取token
     * @param code code
     * @param state state
     * @return WechatAuthDTO
     */
    WechatAuthDTO getWechatToken(String code, String state);
}
